<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">

<head>
    <head th:include="common :: header"></head>
    <!--Font Awesome [ OPTIONAL ]-->
    <link th:href="@{/assets/css/magic-check.min.css}" rel="stylesheet">
</head>

<body>
<div id="page-content">

    <div class="row">
        <div class="col-lg-12">
            <div class="panel">
                <form id="dataForm" class="form-horizontal" th:action="@{${action}}" th:object="${vo}" method="post">
                    <input type="hidden" name="id" th:field="*{id}">
                    <div class="panel-body">
                        <p class="text-main text-bold">基本资料</p>
                        <hr>
                        <div class="form-group">
                            <label class="col-lg-3 col-sm-2 control-label">名称</label>
                            <div class="col-lg-7 col-sm-9">
                                <input type="text" class="form-control" name="name" th:field="*{name}" placeholder="名称" data-bv-notempty="true"
                                       data-bv-notempty-message="角色名称不能为空"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 col-sm-2 control-label">角色编码</label>
                            <div class="col-lg-7 col-sm-9">
                                <input type="text" class="form-control" name="code" th:field="*{code}" placeholder="角色编码" data-bv-notempty="true"
                                       data-bv-notempty-message="角色编码不能为空"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 col-sm-2 control-label">描述</label>
                            <div class="col-lg-7 col-sm-9">
                                <textarea type="text" class="form-control" name="descr" placeholder="描述" th:field="*{descr}"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="panel-footer"  th:if="${!readOnly}">
                        <div class="row">
                            <div class="col-sm-12">
                                <button class="btn btn-primary" type="submit">提交</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>



</div>
<!-- END SETTINGS -->
<div th:include="common :: script"></div>
<!--Form validation [ SAMPLE ]-->
<!--<script th:src="@{/assets/js/form-validation.js}"></script>-->
<script th:inline="javascript">
    $(function() {
        var readOnly = [[${readOnly}]];
        if (readOnly) {
            $("input,select,textarea").attr("disabled", "disabled");
        } else {
            $.freedom.action.save(document.getElementsByTagName("form")[0].getAttribute("id"));
        }
    });
</script>
</body>
</html>
